<?php require_once('../Connections/mlu.php'); 

$colname_Recordset1 = $_GET['idcliente'];
mysql_select_db($database_mlu, $mlu);
$query_Recordset1 = "SELECT * FROM clienti WHERE ID = ". $colname_Recordset1;
$Recordset1 = mysql_query($query_Recordset1, $mlu) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);

mysql_free_result($Recordset1);
?>

<script language="javascript" type="text/javascript">
	$('#salvai').click(function() {
	   var cognome,nome,indirizzo,city,mail,provincia,casa,cellu;
	   cognome=$("input[name='Cognome']").val();
	   nome=$("input[name='Nome']").val();
	   indirizzo=$("input[name='Indirizzo']").val();
	   city=$("input[name='City']").val();
	   provincia=$("input[name='Provincia']").val();
	   casa=$("input[name='Telcasa']").val();
	   cellu=$("input[name='TelCellu']").val();
	   mail=$("input[name='Mail']").val();
	   var dati="cognome="+cognome+"&nome="+nome+"&indirizzo='"+indirizzo+"'&city="+city+"&mail="+mail+"&prov="+provincia+"&casa="+casa+"&cellu="+cellu;
	   var jrole = "clienti/salva.php?id=<?php echo $row_Recordset1['ID']; ?>&"+dati;
	   alert (jrole);
	   $('#index').slideUp(1000,function(){$('#index').load(jrole,'',$('#index').slideDown(1000))});
    }); 

</script>


  <table align="center">
    <tr valign="baseline">
      <td nowrap align="right">ID:</td>
      <td><?php echo $row_Recordset1['ID']; ?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Cognome:</td>
      <td><input type="text" name="Cognome" value="<?php echo $row_Recordset1['Cognome']; ?>" size="32"></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Nome:</td>
      <td><input type="text" name="Nome" value="<?php echo $row_Recordset1['Nome']; ?>" size="32"></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Indirizzo:</td>
      <td><input type="text" name="Indirizzo" value="<?php echo $row_Recordset1['Indirizzo']; ?>" size="32"></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">City:</td>
      <td><input type="text" name="City" value="<?php echo $row_Recordset1['City']; ?>" size="32"></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Provincia:</td>
      <td><input type="text" name="Provincia" value="<?php echo $row_Recordset1['provincia']; ?>" size="32"></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Telcasa:</td>
      <td><input type="text" name="Telcasa" value="<?php echo $row_Recordset1['Telcasa']; ?>" size="32"></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">TelCellu:</td>
      <td><input type="text" name="TelCellu" value="<?php echo $row_Recordset1['TelCellu']; ?>" size="32"></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Mail:</td>
      <td><input type="text" name="Mail" value="<?php echo $row_Recordset1['mail']; ?>" size="32"></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">&nbsp;</td>
      <td><input type="submit"  id="salvai" value="Aggiorna record"></td>
    </tr>
  </table>
